return $this->checkResult( $key, $result );
}
- public function incr( $key, $value = 1 ) {
+ public function incr( $key, $value = 1, $flags = 0 ) {
$this->debug( "incr($key)" );
$result = $this->acquireSyncClient()->increment( $key, $value );
return $this->checkResult( $key, $result );
}
- public function decr( $key, $value = 1 ) {
+ public function decr( $key, $value = 1, $flags = 0 ) {
$this->debug( "decr($key)" );
$result = $this->acquireSyncClient()->decrement( $key, $value );
// The PECL implementation is a naïve for-loop so use async I/O to pipeline;
// https://github.com/php-memcached-dev/php-memcached/blob/master/php_memcached.c#L1852
- if ( ( $flags & self::WRITE_BACKGROUND ) == self::WRITE_BACKGROUND ) {
+ if ( $this->fieldHasFlags( $flags, self::WRITE_BACKGROUND ) ) {
$client = $this->acquireAsyncClient();
$result = $client->setMulti( $data, $exptime );
$this->releaseAsyncClient( $client );
// The PECL implementation is a naïve for-loop so use async I/O to pipeline;
// https://github.com/php-memcached-dev/php-memcached/blob/7443d16d02fb73cdba2e90ae282446f80969229c/php_memcached.c#L1852
- if ( ( $flags & self::WRITE_BACKGROUND ) == self::WRITE_BACKGROUND ) {
+ if ( $this->fieldHasFlags( $flags, self::WRITE_BACKGROUND ) ) {
$client = $this->acquireAsyncClient();
$resultArray = $client->deleteMulti( $keys ) ?: [];
$this->releaseAsyncClient( $client );